<template>
	<uni-section title="签到领积分" type="line">
		<view class="cu-w-100 cu-px-20 cu-row cu-j-sb">
			<block v-for="(item,idx) in 7">
				<view :key="idx" class="cu-d-flex cu-flex-column cu-j-center cu-a-center">
					<u-icon name="checkmark-circle-fill" :color="signedList.includes(item) ? '#4cd964' : '#CCCCCC'" :size="60"></u-icon>
					<text :style="{
						color:signedList.includes(item) ? '#4cd964' : '#CCCCCC'
					}">周
						<block v-if="item == 0">天</block>
						<block v-else-if="item == 1">一</block>
						<block v-else-if="item == 2">二</block>
						<block v-else-if="item == 3">三</block>
						<block v-else-if="item == 4">四</block>
						<block v-else-if="item == 5">五</block>
						<block v-else-if="item == 6">六</block>
					</text>
				</view>
			</block>
			<view class="cu-w-100 cu-px-20 cu-mt-20 cu-pb-20 cu-d-flex cu-flex-column cu-a-center cu-j-center">
				<u-button :disabled="signed" @click="event('sign')" :text="signed === false ? '立即签到' : '今日已签到'" color="linear-gradient(to right, rgb(66, 83, 216), rgb(213, 51, 186))"></u-button>
				<text class="cu-font-sm">连续签到额外+10</text>
			</view>
		</view>
	</uni-section>
</template>

<script>
	export default {
		name: "cu-sign",
		emits: ['sign'],
		props: {
			signedList:{
				type: Array,
				default: []
			},
			signed:{
				type: Boolean,
				default: false
			}
		},
		data() {
			return {
				
			};
		},
		methods:{
			event(type, data) {
				if(type === 'sign'){
					this.$emit(type)
				}
			}
		}
	}
</script>

<style lang="scss">
.uni-section-content{
	padding: 10px;
}

</style>
